<template>
  <a-form class="common-form" v-bind="form">
    <template v-for="formItem in formItemList" :key="formItem.formProps.name">
      <FormItem :option="formItem" :form-model="form.model" />
    </template>
  </a-form>
</template>

<script setup lang="ts">
import type { FormItemOption, FormProps } from '../types'
import { FormItem } from '@/components/Form'

withDefaults(
  defineProps<{
    form: FormProps
    loading?: boolean
    formItemList: FormItemOption<{ [key: string]: any }>[]
  }>(),
  {
    loading: false,
  }
)
</script>
